<script src="<?=$this->baseUrl()?>/js/product.js"></script>

<h1>Products </h1>
<div style="background-color: red;display: none;width:100px;height: 100px;" id="pop"></div>
<table border="0">
        <?php
        $i=0;
        $datas=$this->data;
        foreach  ($this->data as $data)//
        {
                $flagOpenTr=false;
                $flagCloseTr=false;

                if($i%3==0)
                {
                        $flagOpenTr=true;
                }
                elseif(($i+1)%3==0)
                {
                        $flagCloseTr=true;
                }
                if($flagOpenTr)
                {
                ?>
                        <tr>
                <?php
                }
                ?>
                <td>

                     <div class="divcss">
                            <div class="divTitle"> <?=$data['name']?> </div>
                            <div class="divImage"> <img src="<?=$this->baseUrl()?>/product_images/<?=$data['image']?>" width="100" height="100" /></div>
                            <div class="divPrice"> <?=$data['price']?> $ </div>
                            <a href="" class="divButton"></a>
                </div>



                </td>
                <?php
                     //   }
                 if($flagCloseTr)
                 {
                ?>
                        </tr>
        <?php
                 }
                $i++;
        }
        ?>
</table>
<?php
echo $this->paginationControl($this->data,
        'Sliding',
        'partials/pagination-control.phtml');

?>